package chapter_17_command.classic;

/**
 * @author yaochenglong
 * @date 2017/10/20
 * 具体command类
 */
public class ConcreteCommand1 extends Command {
    //对哪个receiver类进行命令处理
    private Receiver receiver;

    //构造函数传递接收者
    public ConcreteCommand1(Receiver receiver) {
        this.receiver = receiver;
    }

    //必须实现一个命令
    @Override
    public void execute() {
        //业务逻辑
        receiver.doSomething();
    }
}
